<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>uupaa-msgpump.js - uuClass.MsgPump.regist</title>
<style type="text/css">@import url(../README.css);</style>
<script type="text/javascript" src="http://uupaa-js-spinoff.googlecode.com/svn/trunk/uupaa-detect.js/uupaa-detect.mini.js"></script>
<script type="text/javascript" src="../uupaa-msgpump.js"></script>
</head>
<body>
<div id="log"></div>
<script>
function boot() {
  // uuClass.Generic, uuClass.Singleton 以外の方法でメッセージを受け取れるオブジェクトを生成する
  receiverObject1 = {
    uuid: 1,
    msgbox: function(msg, p1, p2) {
      var e = document.getElementById("log");
      e.innerHTML += "<br />" + msg + " receiverObject1";
    }
  };
  receiverObject2 = {
    uuid: 2,
    msgbox: function(msg, p1, p2) {
      var e = document.getElementById("log");
      e.innerHTML += "<br />" + msg + " receiverObject2";
    }
  };
  uu.msg.regist(receiverObject1, receiverObject2).post(0, "Hello").post(1, "Hello 1");
}
window.onload = boot;
</script>
<pre class="eg">
function boot() {
  <u>// uuClass.Generic, uuClass.Singleton 以外の方法でメッセージを受け取れるオブジェクトを生成する</u>
  receiverObject1 = {
    <b>uuid</b>: 1,
    <b>msgbox</b>: function(msg, p1, p2) {
      var e = document.getElementById("log");
      e.innerHTML += "&lt;br /&gt;" + msg + " receiverObject1";
    }
  };
  receiverObject2 = {
    <b>uuid</b>: 2,
    <b>msgbox</b>: function(msg, p1, p2) {
      var e = document.getElementById("log");
      e.innerHTML += "&lt;br /&gt;" + msg + " receiverObject1";
    }
  };
  <b>uu.msg.regist</b>(receiverObject1, receiverObject2).<b>post</b>(0, "Hello").<b>post</b>(1, "Hello 1");
}
window.onload = boot;
</pre>
</body></html>
